3.194 \(\int (a+b \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=19 \[ a x+\frac{b \tan (e+f x)}{f}-b x \]

[Out]

a*x - b*x + (b*Tan[e + f*x])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0119024, antiderivative size = 19, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3473, 8} \[ a x+\frac{b \tan (e+f x)}{f}-b x \]

Antiderivative was successfully verified.

[In]

Int[a + b*Tan[e + f*x]^2,x]

[Out]

a*x - b*x + (b*Tan[e + f*x])/f

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \left (a+b \tan ^2(e+f x)\right ) \, dx &=a x+b \int \tan ^2(e+f x) \, dx\\ &=a x+\frac{b \tan (e+f x)}{f}-b \int 1 \, dx\\ &=a x-b x+\frac{b \tan (e+f x)}{f}\\ \end{align*}

Mathematica [A]  time = 0.006066, size = 28, normalized size = 1.47 \[ a x-\frac{b \tan ^{-1}(\tan (e+f x))}{f}+\frac{b \tan (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[a + b*Tan[e + f*x]^2,x]

[Out]

a*x - (b*ArcTan[Tan[e + f*x]])/f + (b*Tan[e + f*x])/f

________________________________________________________________________________________

Maple [A]  time = 0., size = 29, normalized size = 1.5 \begin{align*} ax+{\frac{b\tan \left ( fx+e \right ) }{f}}-{\frac{b\arctan \left ( \tan \left ( fx+e \right ) \right ) }{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a+b*tan(f*x+e)^2,x)

[Out]

a*x+b*tan(f*x+e)/f-b/f*arctan(tan(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 1.61604, size = 31, normalized size = 1.63 \begin{align*} a x - \frac{{\left (f x + e - \tan \left (f x + e\right )\right )} b}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(f*x+e)^2,x, algorithm="maxima")

[Out]

a*x - (f*x + e - tan(f*x + e))*b/f

________________________________________________________________________________________

Fricas [A]  time = 1.05917, size = 46, normalized size = 2.42 \begin{align*} \frac{{\left (a - b\right )} f x + b \tan \left (f x + e\right )}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(f*x+e)^2,x, algorithm="fricas")

[Out]

((a - b)*f*x + b*tan(f*x + e))/f

________________________________________________________________________________________

Sympy [A]  time = 0.161364, size = 20, normalized size = 1.05 \begin{align*} a x + b \left (\begin{cases} - x + \frac{\tan{\left (e + f x \right )}}{f} & \text{for}\: f \neq 0 \\x \tan ^{2}{\left (e \right )} & \text{otherwise} \end{cases}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(f*x+e)**2,x)

[Out]

a*x + b*Piecewise((-x + tan(e + f*x)/f, Ne(f, 0)), (x*tan(e)**2, True))

________________________________________________________________________________________

Giac [B]  time = 1.19552, size = 340, normalized size = 17.89 \begin{align*} a x + \frac{{\left (\pi - 4 \, f x \tan \left (f x\right ) \tan \left (e\right ) - \pi \mathrm{sgn}\left (2 \, \tan \left (f x\right )^{2} \tan \left (e\right ) + 2 \, \tan \left (f x\right ) \tan \left (e\right )^{2} - 2 \, \tan \left (f x\right ) - 2 \, \tan \left (e\right )\right ) \tan \left (f x\right ) \tan \left (e\right ) - \pi \tan \left (f x\right ) \tan \left (e\right ) + 2 \, \arctan \left (\frac{\tan \left (f x\right ) \tan \left (e\right ) - 1}{\tan \left (f x\right ) + \tan \left (e\right )}\right ) \tan \left (f x\right ) \tan \left (e\right ) + 2 \, \arctan \left (\frac{\tan \left (f x\right ) + \tan \left (e\right )}{\tan \left (f x\right ) \tan \left (e\right ) - 1}\right ) \tan \left (f x\right ) \tan \left (e\right ) + 4 \, f x + \pi \mathrm{sgn}\left (2 \, \tan \left (f x\right )^{2} \tan \left (e\right ) + 2 \, \tan \left (f x\right ) \tan \left (e\right )^{2} - 2 \, \tan \left (f x\right ) - 2 \, \tan \left (e\right )\right ) - 2 \, \arctan \left (\frac{\tan \left (f x\right ) \tan \left (e\right ) - 1}{\tan \left (f x\right ) + \tan \left (e\right )}\right ) - 2 \, \arctan \left (\frac{\tan \left (f x\right ) + \tan \left (e\right )}{\tan \left (f x\right ) \tan \left (e\right ) - 1}\right ) - 4 \, \tan \left (f x\right ) - 4 \, \tan \left (e\right )\right )} b}{4 \,{\left (f \tan \left (f x\right ) \tan \left (e\right ) - f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(f*x+e)^2,x, algorithm="giac")

[Out]

a*x + 1/4*(pi - 4*f*x*tan(f*x)*tan(e) - pi*sgn(2*tan(f*x)^2*tan(e) + 2*tan(f*x)*tan(e)^2 - 2*tan(f*x) - 2*tan(
e))*tan(f*x)*tan(e) - pi*tan(f*x)*tan(e) + 2*arctan((tan(f*x)*tan(e) - 1)/(tan(f*x) + tan(e)))*tan(f*x)*tan(e)
 + 2*arctan((tan(f*x) + tan(e))/(tan(f*x)*tan(e) - 1))*tan(f*x)*tan(e) + 4*f*x + pi*sgn(2*tan(f*x)^2*tan(e) +
2*tan(f*x)*tan(e)^2 - 2*tan(f*x) - 2*tan(e)) - 2*arctan((tan(f*x)*tan(e) - 1)/(tan(f*x) + tan(e))) - 2*arctan(
(tan(f*x) + tan(e))/(tan(f*x)*tan(e) - 1)) - 4*tan(f*x) - 4*tan(e))*b/(f*tan(f*x)*tan(e) - f)